██████╗ ███████╗████████╗██╗██████╗ ███████╗██████╗ ██╗ █████╗
██╔══██╗██╔════╝╚══██╔══╝██║██╔══██╗██╔════╝██╔══██╗██║██╔══██╗
██████╔╝█████╗ ██║ ██║██████╔╝█████╗ ██║ ██║██║███████║
██╔══██╗██╔══╝ ██║ ██║██╔═══╝ ██╔══╝ ██║ ██║██║██╔══██║
██║ ██║███████╗ ██║ ██║██║ ███████╗██████╔╝██║██║ ██║
╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝╚═╝ ╚══════╝╚═════╝ ╚═╝╚═╝ ╚═╝
- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Web Services Description Language
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
top
Il mwawWeb Services Description Language (mwbaWSDL) è un mwbqlinguaggio formale in formato mwbgXML utilizzato per la creazione di "documenti" per la descrizione di mwbwWeb service.
Contents
• Note
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Descrizione
Mediante WSDL può essere infatti descritta l'mwcwinterfaccia pubblica di un Web service (ovvero una descrizione basata su XML) che indica come interagire con un determinato servizio.
Un "documento" WSDL contiene infatti, relativamente al Web service descritto, informazioni su:
• mwdwcosa può essere utilizzato (le "operazioni" messe a disposizione dal servizio)
• mweqcome sfruttare tale raggruppamento (specificando il mwegprotocollo di comunicazione da utilizzare per accedere al servizio, il formato dei messaggi accettati in mwewinput e restituiti in mwfaoutput dal servizio ed i mwfqdati correlati) ovvero i "vincoli" (mwfgin inglese mwfwbindings) del servizio;
• mwgqdove si trova il servizio nella rete (cosiddetto mwggendpoint o mwgwport del servizio che solitamente corrisponde all'indirizzo — in formato mwhaURI — che rende disponibile il Web service)
Le operazioni supportate dal Web service ed i messaggi che è possibile scambiare con lo stesso sono descritti in maniera astratta e quindi non collegati ad uno specifico mwhgprotocollo di rete e ad uno specifico formato.
Il WSDL è solitamente utilizzato in combinazione con mwiaSOAP e mwiqXML Schema per rendere disponibili Web service su mwigreti aziendali o su mwiwinternet: un programma mwjaclient può, infatti, "leggere" il documento WSDL relativo ad un Web service per determinare quali siano le funzioni messe a disposizione sul mwjqserver e attraverso il protocollo SOAP utilizzare una o più delle funzioni elencate dal WSDL.
La versione 1.1 di WSDL non è stata adottata come mwjwstandard dal mwkaWorld Wide Web Consortium (W3C).
Il 26 giugno 2007 la versione 2.0 è stata promossa a standard ufficiale (in forma di "raccomandazione") dal W3C.
Stili e codifiche
• mwngRPC/encoded: ha una struttura molto semplice, ma non è approvato dallo standard mwnwWS-I ed è complesso da validare.
• mwoqRPC/literal: è di nuovo molto semplice ed è privo di informazioni di codifica sui tipi. Soddisfa inoltre le specifiche WS-I, ma resta complesso da validare.
• mwowDocument/encoded: non è conforme alle specifiche WS-I e non è praticamente mai utilizzato.
• mwpqDocument/literal: anche qui mancano le informazioni di codifica sui tipi ed è conforme alle specifiche WS-I (con alcune restrizioni). Può inoltre essere facilmente controllato con un mwpgvalidatore XML. Tuttavia, la struttura del WSDL diventa più complessa e verbosa. Infine, nel messaggio SOAP non è prevista l'indicazione del metodo utilizzato, per cui può risultare più complesso (o impossibile) capire quale operazione è richiesta dal client.
Esempio di documento WSDL 2.0
<?xml version="1.0" encoding="UTF-8"?>
<description xmlns="http://www.w3.org/ns/wsdl"
xmlns:tns="http://www.example.com/wsdl20sample"
xmlns:whttp="http://www.w3.org/ns/wsdl/http"
xmlns:wsoap="http://www.w3.org/ns/wsdl/soap"
targetNamespace="http://www.example.com/wsdl20sample">
<!-- Abstract types -->
<types>
<xs:schema xmlns="http://www.example.com/wsdl20sample"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.example.com/wsdl20sample">
<xs:element name="request">
<xs:complexType>
<xs:sequence>
<xs:element name="header" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="body" type="xs:anyType" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="method" type="xs:string" use="required"/>
<xs:attribute name="uri" type="xs:anyURI" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="response">
<xs:complexType>
<xs:sequence>
<xs:element name="header" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="body" type="xs:anyType" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="status-code" type="xs:anySimpleType" use="required"/>
<xs:attribute name="response-phrase" use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>
</types>
<!-- Abstract interfaces -->
<interface name="RESTfulInterface">
<fault name="ClientError" element="tns:response"/>
<fault name="ServerError" element="tns:response"/>
<fault name="Redirection" element="tns:response"/>
<operation name="Get" pattern="http://www.w3.org/ns/wsdl/in-out">
<input messageLabel="GetMsg" element="tns:request"/>
<output messageLabel="SuccessfulMsg" element="tns:response"/>
</operation>
<operation name="Post" pattern="http://www.w3.org/ns/wsdl/in-out">
<input messageLabel="PostMsg" element="tns:request"/>
<output messageLabel="SuccessfulMsg" element="tns:response"/>
</operation>
<operation name="Put" pattern="http://www.w3.org/ns/wsdl/in-out">
<input messageLabel="PutMsg" element="tns:request"/>
<output messageLabel="SuccessfulMsg" element="tns:response"/>
</operation>
<operation name="Delete" pattern="http://www.w3.org/ns/wsdl/in-out">
<input messageLabel="DeleteMsg" element="tns:request"/>
<output messageLabel="SuccessfulMsg" element="tns:response"/>
</operation>
</interface>
<!-- Concrete Binding Over HTTP -->
<binding name="RESTfulInterfaceHttpBinding" interface="tns:RESTfulInterface"
type="http://www.w3.org/ns/wsdl/http">
<operation ref="tns:Get" whttp:method="GET"/>
<operation ref="tns:Post" whttp:method="POST"
whttp:inputSerialization="application/x-www-form-urlencoded"/>
<operation ref="tns:Put" whttp:method="PUT"
whttp:inputSerialization="application/x-www-form-urlencoded"/>
<operation ref="tns:Delete" whttp:method="DELETE"/>
</binding>
<!-- Concrete Binding with SOAP-->
<binding name="RESTfulInterfaceSoapBinding" interface="tns:RESTfulInterface"
type="http://www.w3.org/ns/wsdl/soap"
wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP/"
wsoap:mepDefault="http://www.w3.org/2003/05/soap/mep/request-response">
<operation ref="tns:Get" />
<operation ref="tns:Post" />
<operation ref="tns:Put" />
<operation ref="tns:Delete" />
</binding>
<!-- Web Service offering endpoints for both the bindings-->
<service name="RESTfulService" interface="tns:RESTfulInterface">
<endpoint name="RESTfulServiceRestEndpoint"
binding="tns:RESTfulInterfaceHttpBinding"
address="http://www.example.com/rest/"/>
<endpoint name="RESTfulServiceSoapEndpoint"
binding="tns:RESTfulInterfaceSoapBinding"
address="http://www.example.com/soap/"/>
</service>
</description>
Note
cite-note-ibm-11. ↑ mwasq(mwasumwasyEN) Russel Butek, mwascmwasgWhich style of WSDL should I use?, su mwaskibm.com, IBM, 31 ottobre 2003. mwasoURL consultato il 10 settembre 2018 mwass(mwaswarchiviato il 23 agosto 2018).
cite-note-22. ↑ mwataMarco Parente, mwatemwatiWSDL: stili e codifiche, su mwatmHTML.it mwatq(mwatuarchiviato il 22 gennaio 2014).
Voci correlate
Collegamenti esterni
• mwauuSpecifiche WSDL 1.1, su w3.org.
• mwaucWSDL 2.0 Specification Part 0: Primer (Latest Version), su w3.org.
• mwaukWSDL 2.0 Specification Part 1: Core (Latest Version), su w3.org.
• mwausWSDL 2.0 Specification Part 2: Adjuncts (Latest Version), su w3.org.
• mwau0Web Services Description Working Group, su w3.org.
• mwau8XML protocol activity, su w3.org.
• mwaveWSDL Validator, su validwsdl.com.